Release 10.1A: OpenEdge Application Server:
Developing AppServer Applications
Session-free programming
You can develop a session-free (state-free operating mode) application much like a stateless session-managed application. However, a session-free application must follow these additional AppServer programming requirements and recommendations:
- Every request (external procedure) runs independently of every other request on the AppServer. No request can create global or persistent data that any subsequent request can ever expect to find, because each request can execute on a different AppServer or AppServer agent.
- You cannot specify a connect or disconnect procedure, and none is ever executed on the AppServer.
- You can specify activate and deactivate procedures to execute before and after each request, but you cannot use them to maintain any contextual data that is not read and written to persistent storage (a database).
- Do not use persistent procedures of any kind, unless you cannot avoid it. Using any persistent procedures (Open Client and Web service ProcObjects) that are called and instantiated directly by the client forces a bound connection to the AppServer, which limits application performance and scalability (see the "Affecting application scalability" section). Persistent procedures also complicate the programming of session-free client applications, which must maintain connection context with every call to an internal procedure or user-defined function. Also, using the AppServer session to create a persistent procedure internally in response to some other client invocation has limited, if any, value. No external procedure invoked by the client can expect to access any persistent resources created by an AppServer session in response to another client invocation, because the latest remote external procedure is likely to execute in a different AppServer agent than the one in which any of these AppServer-created persistent resources reside.
Affecting application scalability
If you instantiate a remote persistent procedure in a session-free application, any network resource that provides the bound connection for the client is unavailable for other clients until that remote persistent procedure is deleted (or released for an Open Client or Web service ProcObject). If enough clients simultaneously create and use instances of this persistent procedure, the application might have no more physical connections available in its connection pool to serve additional clients.
Thus, if all clients that use the application service are always required to create an instance of this remote persistent procedure, the application service is scalable only for the number of clients that can simultaneously create that remote persistent procedure. Even if clients are not required to create this persistent procedure for all uses of the application service, any clients that do so reduce the availability of network resources to other clients and limit the scalability of the application service accordingly.
Thus, to allow a session-free application service to scale fully for the network resources available, do not allow any clients to instantiate remote persistent procedures. For Open Client and Web service applications, you can do this by not defining any ProcObjects in the Open Client interface.
SESSION handle attributes and state-free operating mode
Functionality of the following
SESSIONhandle attributes is modified or not supported with the state-free operating mode:For more information, see the "Progress 4GL for programming AppServer procedures" section.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |